<%@ page language="java" contentType="text/html; charset=UTF8"
    pageEncoding="UTF8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF8">
    <title>Articles</title>  
<!--  <link rel="stylesheet" type="text/css" href="common/css/allArticle.css"> -->
 <link rel="stylesheet" href="component/bootstrap-3.3.7-dist/css/bootstrapUI.css">
    <link rel="stylesheet" href="common/css/pintuer.css">
  <!--   <link rel="stylesheet" href="common/css/admin.css"> -->
    	<link rel="stylesheet" href="common/css/popupUI.css">
    	<script type="text/javascript" src="component/jquery-3.1.1.js"></script>
    <script type="text/javascript" src="common/js/managementUI.js"></script>
    <script type="text/JavaScript" src="<%=request.getContextPath()%>/ckeditor/ckeditor.js"></script>  
     
<!--   <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit"> -->
 
   <!--  <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="js/jquery.js"></script>
    <script src="js/pintuer.js"></script>
    <script src="js/respond.js"></script>
    <script src="js/admin.js"></script> -->
<!--     <link type="image/x-icon" href="/favicon.ico" rel="shortcut icon" />
    <link href="/favicon.ico" rel="bookmark icon" />
     -->
</head>
<body>
<!-- <div class="product-header-content">
		<div class="logo">
			<img src="common/images/logoLeft.png">
		</div>
		<div class="logoRight">
		<img src="common/images/logoRight.png">
		</div>
</div> -->


<div class="admin">
    <div class="panel admin-panel">
    	<div class="panel-head" style="text-align:center"><strong>Article List</strong></div>
        <div class="padding border-bottom text-right" >
          <!--   <input type="button" class="button button-small checkall" name="checkall" checkfor="id" value="全选" /> -->
            <button type="button" id="addButton" class="button button-small border-blue" style="text-align:right"><spring:message code="ADD"/></button>
           <!--  <input type="button" class="button button-small border-yellow" value="批量删除" />
            <input type="button" class="button button-small border-blue" value="回收站" /> -->
        </div>
        <table class="table table-hover" style="table-layout:fixed">
        	<tr><th width="45" style="text-align:center"><spring:message code="ID"/></th><th width="150" style="text-align:center"><spring:message code="SUBJECT"/></th><th width="50" style="text-align:center"><spring:message code="SENDER"/></th><th width="50" style="text-align:center"><spring:message code="TIME"/></th><th width="80" style="text-align:center"><spring:message code="ACTION"/></th></tr>
             <c:if test="${!empty articleList }">  
                <c:forEach items="${articleList}" var="article">  
                    <tr>  
                        <td style="text-align:center">${article.article_id}</td>  
                        <td style="white-space:nowrap;overflow:hidden;width:100px">${article.subject}</td>
                        <td style="text-align:center;white-space:nowrap;overflow:hidden">${article.sender }</td>  
                        <td style="text-align:center;white-space:nowrap;overflow:hidden">${article.time }</td>  
                        <%-- <td>${article.if_delete }</td> --%>  

                        <td style="text-align:center">  
                        <%-- <button type="button" class="btn4" id="back" onclick= "window.location='toEdit.action?article_id=${article.article_id}'"><spring:message code="Edit"/></button> 
                        <button type="button" class="btn5" id="back" onclick= "window.location='deleteArticle.action?article_id=${article.article_id}'"><spring:message code="Delete"/></button>    --%>     
                        
                        <a class="button border-blue button-little" onclick="window.location='toEdit.action?article_id=${article.article_id}'"><spring:message code="Edit"/></a> <a class="button border-yellow button-little" onclick="window.location='deleteArticle.action?article_id=${article.article_id}'"><spring:message code="Delete"/></a>
                        </td>  
                    </tr>               
                </c:forEach>  
            </c:if>  
          </table>
          
          <div class="panel-foot text-right">
           <ul class="pagination"><li><a href="allByPage.action?number=1"><spring:message code="FirstPage"/></a></li></ul>
            <ul class="pagination"><li><a href="allByPage.action?number=${sessionScope.number-1}"><spring:message code="Last"/></a></li></ul>
            <ul class="pagination"><li><a href="allByPage.action?number=${sessionScope.number+1}"><spring:message code="Next"/></a></li></ul>
               <ul class="pagination"><li><a href="allByPage.action?number=${sessionScope.count}"><spring:message code="Final"/></a></li></ul>
              <font style="line-height:2.5"><spring:message code="currentpage"/>${sessionScope.number}/${sessionScope.count}</font>
        </div>
     </div>
  </div> 

		
		<!-- popup -->
	<div class="fullScreen" id="addArticle" >
		<div class="modal-content">
			<div class="popup">
				<div class="modal-header" style="height:50">
					<div class="row">
						<div class="col col-md-11" id="articleTitle">
					<h3 class='modal-title' style="font-size:18px;color:gray;padding:10px 10px"><spring:message code="ADD"/></h3>
						</div>
						<div class="col-md-1">
							<button type="button" class="close close-lg" id="closePopupIndex">×</button>
						</div>
					</div>
				</div>
				<div id="MailerContentArea"  style="height:510px">
					<div class="mailerContent" id="articleContentIndex">
						<%-- ${content} --%>
						<form action="addArticle.action" method="post">
    <input type="text" name="subject" placeholder="Title" style="width:100%; height:40px; font-size:22px; text-align:center"/><br/>
	<input type="text" name="sender" placeholder="Sender" style="width:49.62%;text-align:center;margin-left:1px;margin-top:1px;"/>
	<input type="text" name="time" placeholder="Time" style="width:49.62%;text-align:center"/><br/> 
	<textarea placeholder="Content" class="ckeditor" cols="80" id="content" name="content" rows="10" >     
	</textarea>    
     <input type="submit" style="margin-left:380px;margin-top:5px;margin-bottom:5px;" value="<spring:message code="ADD"/>" class="button button-small border-blue">
 

</form>
					</div>
				</div>
			</div>
		</div>		
	</div>
		
		
<%-- <div class="buttonlist">
	<button type="button" class="btn7" value="Add" onclick="window.location.href='toAdd.action'" ><spring:message code="ADD"/></button>
	<!-- <button type="button" class="btn6" id="back"  onclick="window.location.href='Announcements.action'">返&nbsp;&nbsp;&nbsp;回</button> -->
</div>
<table border="1"  class="datalist" >  
        <tbody>  
        <caption class="title" style="margin-left: 32px;font-size=20px">Article List</caption> 
            <tr>  
                <th>ID</th>  
                <th class="altrow" style="width:400px"><spring:message code="SUBJECT"/></th>  
                <th class="altrow"><spring:message code="SENDER"/></th>
                <th><spring:message code="TIME"/></th>
                <!-- <th class="altrow">IF_DELETE</th> -->

                <th><spring:message code="ACTION"/></th>
            </tr>  
            <c:if test="${!empty articleList }">  
                <c:forEach items="${articleList}" var="article">  
                    <tr>  
                        <td>${article.article_id }</td>  
                        <td style="width:400px;font-weight:bold">${article.subject }</td>
                        <td>${article.sender }</td>  
                        <td>${article.time }</td>  
                        <td>${article.if_delete }</td>  

                        <td>  
                        <button type="button" class="btn4" id="back" onclick= "window.location='toEdit.action?article_id=${article.article_id}'"><spring:message code="Edit"/></button> 
                        <button type="button" class="btn5" id="back" onclick= "window.location='deleteArticle.action?article_id=${article.article_id}'"><spring:message code="Delete"/></button>        
                        </td>  
                    </tr>               
                </c:forEach>  
            </c:if>  
        </tbody>  
    </table>
    <div class="navi" style="width:280px;margin: 0 auto;padding-top: 20px;">
    	<a href="allByPage.action?number=1"><spring:message code="FirstPage"/></a>
		<a href="allByPage.action?number=${sessionScope.number-1}"><spring:message code="Last"/></a>
		<a href="allByPage.action?number=${sessionScope.number+1}"><spring:message code="Next"/></a>
		<a href="allByPage.action?number=${sessionScope.count}"><spring:message code="Final"/></a>
		<font><spring:message code="currentpage"/>${sessionScope.number}/${sessionScope.count}</font>
	</div> --%>
</body>
</html>